package cloud.demarcia.rabbitregister.exception;

import cloud.demarcia.rabbitregister.enums.LoginStatusCode;
import cloud.demarcia.rabbitregister.enums.RegisterStatusCode;

/**
 * @author Bojun Wen, wen_bj@outlook.com
 * @date 2022.02.19
 */
public class RabbitLoginException extends RuntimeException{
    LoginStatusCode loginStatusCode;
    public RabbitLoginException(LoginStatusCode loginStatusCode) {
        super(loginStatusCode.getMessage());
        this.loginStatusCode =loginStatusCode;
    }
    public int getErrorCode() {
        return loginStatusCode.getCode();
    }

    public String getErrorMessage() {
        return loginStatusCode.getMessage();
    }
}
